﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AnimaGestionPersonnage.Utilities;
using AnimaGestionPersonnage.Properties;

namespace AnimaGestionPersonnage.Vue
{
    public partial class FormChoice : Form
    {
        public FormChoice()
        {
            InitializeComponent();
        }

        private void quitButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void createButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            Utils.setCurrentState(Utils.NEW_STATE);
            new FormPrincStats().ShowDialog(this, Utils.NEW_STATE);
        }

        private void loadCharButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            Utils.setCurrentState(Utils.LOAD_STATE);
            new FormPrincStats().ShowDialog(this, Utils.LOAD_STATE);
        }

        private void buttonEditSkills_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormEditSkills().ShowDialog(this);
        }

        private void buttonCreateClass_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateCharClass().ShowDialog(this);
        }

        private void buttonCreateRace_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateRace().ShowDialog(this);
        }

        private void buttonAdvDisadvEdit_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateAdvDisadv().ShowDialog(this);
        }

        private void choiceForm_Load(object sender, EventArgs e)
        {
            Utils.xmlDeserializeAllSkills();
            Utils.xmlDeserializeClasses(Settings.Default.FilePath + Settings.Default.ClassList);
            Utils.xmlDeserializeRaces(Settings.Default.FilePath + Settings.Default.RaceList);
            Utils.xmlDeserializeAdvDisadv(Settings.Default.FilePath + Settings.Default.AdvDisadv);
            Utils.xmlDeserializeWeapons(Settings.Default.FilePath + Settings.Default.WeaponFile);
            Utils.xmlDeserializeTypicalModules(Settings.Default.FilePath + Settings.Default.TypicalModule);
            Utils.xmlDeserializeCombatModules(Settings.Default.FilePath + Settings.Default.CombatModule);
        }

        private void buttonCreateWeapon_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateWeapon().ShowDialog(this);
        }

        private void buttonTypicalModule_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateTypicalModule().ShowDialog(this);
        }

        private void buttonCombatModule_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateCombatModule().ShowDialog(this);
        }

        private void buttonCreateMA_Click(object sender, EventArgs e)
        {
            this.Hide();
            new FormCreateMA().ShowDialog(this);
        }
    }
}
